﻿using BCEntity.Sim.Admin.TreePermission;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BCData.Sim.Admin.TreePermission
{
    /// <summary>
    /// 树形权限配置记录
    /// </summary>
    public interface ITreePermissionRecordData
    {
        /// <summary>
        /// 删除树形权限配置记录
        /// </summary>
        /// <param name="treePermissionConfigId">树形权限配置Id</param>
        /// <returns></returns>
        Task<int> Delete(long treePermissionConfigId);

        /// <summary>
        /// 获取员工树形权限配置记录
        /// </summary>
        /// <param name="adminId">员工ID</param>
        /// <param name="treePermissionConfigId">树形权限配置Id</param>
        /// <returns></returns>
        Task<TreePermissionRecordEntity> GetEntityByAdminIdAsync(long adminId, long treePermissionConfigId);

        /// <summary>
        /// 添加树形权限配置记录
        /// </summary>
        /// <param name="entity">树形权限配置记录</param>
        /// <returns></returns>
        Task<TreePermissionRecordEntity> InsertAsync(TreePermissionRecordEntity entity);

        /// <summary>
        /// 删除员工树形权限配置记录
        /// </summary>
        /// <param name="treePermissionConfigId">树形权限配置Id</param>
        /// <param name="staffOrganizationMappingRecordId">员工组织映射记录ID</param>
        /// <returns></returns>
        Task<int> DeleteStaffOrganizationMappingRecordId(long treePermissionConfigId, long staffOrganizationMappingRecordId);

        /// <summary>
        /// 获取部门树形权限配置记录
        /// </summary>
        /// <param name="departmentId">部门Id</param>
        /// <param name="treePermissionConfigId">树形权限配置Id</param>
        /// <returns></returns>
        Task<TreePermissionRecordEntity> GetEntityByDepartmentIdAsync(int departmentId, long treePermissionConfigId);

        /// <summary>
        /// 获取公司树形权限配置记录
        /// </summary>
        /// <param name="companyId">公司Id</param>
        /// <param name="treePermissionConfigId">树形权限配置Id</param>
        /// <returns></returns>
        Task<TreePermissionRecordEntity> GetEntityByCompanyIdAsync(int companyId, long treePermissionConfigId);

        /// <summary>
        /// 删除公司树形权限配置记录
        /// </summary>
        /// <param name="treePermissionConfigId">树形权限配置Id</param>
        /// <param name="companyId">公司ID</param>
        /// <returns></returns>
        Task<int> DeleteCompany(long treePermissionConfigId, int companyId);

        /// <summary>
        /// 删除部门树形权限配置记录
        /// </summary>
        /// <param name="treePermissionConfigId">树形权限配置Id</param>
        /// <param name="departmentId">部门ID</param>
        /// <returns></returns>
        Task<int> DeleteDepartment(long treePermissionConfigId, int departmentId);

        /// <summary>
        /// 获取树形权限配置记录
        /// </summary>
        /// <param name="companyId">公司ID</param>
        /// <param name="departmentId">部门ID</param>
        /// <param name="staffOrganizationMappingRecordId">员工部门映射记录Id</param>
        /// <returns></returns>
        Task<IEnumerable<TreePermissionRecordViewEntity>> GetList(int? companyId, int? departmentId, long? staffOrganizationMappingRecordId);

        /// <summary>
        /// 获取员工树形权限配置记录
        /// </summary>
        /// <param name="staffOrganizationMappingRecordId">员工ID</param>
        /// <returns></returns>
        Task<IEnumerable<TreePermissionConfigEntity>> GetListByAdminIdAsync(long? staffOrganizationMappingRecordId);

        /// <summary>
        /// 获取员工树形权限配置记录
        /// </summary>
        /// <param name="adminId">员工ID</param>
        /// <returns></returns>
        Task<IEnumerable<TreePermissionRecordViewEntity>> GetPermissionRecordListByAdminId(long? adminId);
    }
}
